<%@page pageEncoding="utf-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        房产管理
    </title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css" media="all">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
    <script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/js/x-layui.js" charset="utf-8"></script>
    <style>
        #a{
            display: inline-block;
            margin-left: 30px;
        }
    </style>
</head>
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>房产管理</cite></a>
              <a><cite>房产列表</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <xblock>
        <button class="layui-btn" onclick="home_add('添加','${pageContext.request.contextPath}/housing/addUi','1000','600')">
            <i class="layui-icon">&#xe608;</i>添加
        </button>
        <form id="a" action="${pageContext.request.contextPath}/housing/selectUi" style="width:800px">

                    <div class="layui-input-inline">
                        <input type="text" name="property"  placeholder="输入房产名称" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-input-inline" style="width:80px">
                        <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                    </div>
        </form>
        <span class="x-right" style="line-height:40px">共有数据：<span class="layui-badge">${pageInfo.size}</span> 条</span>
    </xblock>
    <table class="layui-table">
        <thead>
        <tr>
            <th>ID</th>
            <th>所属小区</th>
            <th>栋数</th>
            <th>房产编码</th>
            <th>房产名称</th>
            <th>户主名称</th>
            <th>联系方式</th>
            <th>房间数</th>
            <th>单元</th>
            <th>楼层</th>
            <th>描述</th>
            <th>入住时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${pageInfo.list}" var="HousingVo" varStatus="status">
            <tr>
                <td>${status.index + 1}</td>
                <td>${HousingVo.comName}</td>
                <td>${HousingVo.buildName}</td>
                <td>${HousingVo.houseId}</td>
                <td>${HousingVo.property}</td>
                <td>${HousingVo.perName}</td>
                <td>${HousingVo.contactWay}</td>
                <td>${HousingVo.roomNumber}</td>
                <td>${HousingVo.unit}</td>
                <td>${HousingVo.floor}</td>
                <td>${HousingVo.describes}</td>
                <td >
                    <fmt:formatDate value="${HousingVo.checkIn}" pattern="yy-MM-dd HH:mm:ss"></fmt:formatDate>
                </td>
                <td class="td-manage">
                    <a title="编辑" href="javascript:;"
                       onclick="housing_edit('编辑','${pageContext.request.contextPath}/housing/editUi','${HousingVo.id}','1000','600')"
                       class="ml-5" style="text-decoration:none">
                        <i class="layui-icon">&#xe642;</i>
                    </a>
                    <a title="删除" href="${pageContext.request.contextPath}/housing/delete?id=${HousingVo.id}" onclick="cli()" style="text-decoration:none">
                        <i class="layui-icon">&#xe640;</i>
                    </a>

                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <div id="page">
        <ul class="pagination">
            <li <c:if test="${pageInfo.pageNum == 1}">class="disabled"</c:if>>
                <a href="${pageContext.request.contextPath}/housing/listUi?pageNum=1">首页</a>
            </li>

            <li >
                <c:if test="${pageInfo.pageNum == 1}">
                    <a class="disabled">上一页</a>
                </c:if>
                <c:if test="${pageInfo.pageNum != 1}">
                <a href="${pageContext.request.contextPath}/housing/listUi?pageNum=${pageInfo.pageNum-1}">上一页</a>
                </c:if>
            </li>

            <c:forEach begin="1" end="${pageInfo.pages}" var="index">
                <li <c:if test="${index == pageInfo.pageNum}">class="active"</c:if>>
                    <a href="${pageContext.request.contextPath}/housing/listUi?pageNum=${index}">${index}</a>
                </li>
            </c:forEach>

            <li >
                <c:if test="${pageInfo.pageNum == pageInfo.pages}">
                    <a class="disabled">下一页</a>
                </c:if>
                <c:if test="${pageInfo.pageNum != pageInfo.pages}">
                <a href="${pageContext.request.contextPath}/housing/listUi?pageNum=${pageInfo.pageNum+1}">下一页</a>
                </c:if>
            </li>

            <li <c:if test="${pageInfo.pageNum == pageInfo.pages}">class="disabled"</c:if>>
                <a href="${pageContext.request.contextPath}/housing/listUi?pageNum=${pageInfo.pages}" >尾页</a>
            </li>
        </ul>

    </div>
</div>
<script src="lib/layui/layui.js" charset="utf-8"></script>
<script src="js/x-layui.js" charset="utf-8"></script>
<script>
    layui.use(['laydate','element','laypage','layer'], function(){
        $ = layui.jquery;//jquery
        laydate = layui.laydate;//日期插件
        lement = layui.element();//面包导航
        laypage = layui.laypage;//分页
        layer = layui.layer;//弹出层

    });

    /*添加*/
    function home_add(title,url,w,h){
        x_admin_show(title,url,w,h);
    }
    //编辑
    function housing_edit (title,url,id,w,h) {
        url = url+"?id="+id;
        x_admin_show(title,url,w,h);
    }

    /*删除*/
    function question_del(obj,id){
    }
</script>
</body>
</html>